  {
    if (_internal_format == GL_ALPHA)	 internal_format =  0;
    if (_internal_format == GL_ALPHA4)	 internal_format =  1;
    if (_internal_format == GL_ALPHA8)	 internal_format =  2;
    if (_internal_format == GL_ALPHA12)	 internal_format =  3;
    if (_internal_format == GL_ALPHA16)	 internal_format =  4;
    if (_internal_format == GL_COMPRESSED_ALPHA)	 internal_format =  5;
    if (_internal_format == GL_COMPRESSED_LUMINANCE)	 internal_format =  6;
    if (_internal_format == GL_COMPRESSED_LUMINANCE_ALPHA)	 internal_format =  7;
    if (_internal_format == GL_COMPRESSED_INTENSITY)	 internal_format =  8;
    if (_internal_format == GL_COMPRESSED_RGB)	 internal_format =  9;
    if (_internal_format == GL_COMPRESSED_RGBA)	 internal_format = 10;
    if (_internal_format == GL_DEPTH_COMPONENT)	 internal_format = 11;
    if (_internal_format == GL_DEPTH_COMPONENT16)	 internal_format = 12;
    if (_internal_format == GL_DEPTH_COMPONENT24)	 internal_format = 13;
    if (_internal_format == GL_DEPTH_COMPONENT32)	 internal_format = 14;
    if (_internal_format == GL_LUMINANCE)	 internal_format = 15;
    if (_internal_format == GL_LUMINANCE4)	 internal_format = 16;
    if (_internal_format == GL_LUMINANCE8)	 internal_format = 17;
    if (_internal_format == GL_LUMINANCE12)	 internal_format = 18;
    if (_internal_format == GL_LUMINANCE16)	 internal_format = 19;
    if (_internal_format == GL_LUMINANCE_ALPHA)	 internal_format = 20;
    if (_internal_format == GL_LUMINANCE4_ALPHA4)	 internal_format = 21;
    if (_internal_format == GL_LUMINANCE6_ALPHA2)	 internal_format = 22;
    if (_internal_format == GL_LUMINANCE8_ALPHA8)	 internal_format = 23;
    if (_internal_format == GL_LUMINANCE12_ALPHA4)	 internal_format = 24;
    if (_internal_format == GL_LUMINANCE12_ALPHA12)	 internal_format = 25;
    if (_internal_format == GL_LUMINANCE16_ALPHA16)	 internal_format = 26;
    if (_internal_format == GL_INTENSITY)	 internal_format = 27;
    if (_internal_format == GL_INTENSITY4)	 internal_format = 28;
    if (_internal_format == GL_INTENSITY8)	 internal_format = 29;
    if (_internal_format == GL_INTENSITY12)	 internal_format = 30;
    if (_internal_format == GL_INTENSITY16)	 internal_format = 31;
    if (_internal_format == GL_R3_G3_B2)	 internal_format = 32;
    if (_internal_format == GL_RGB)	 internal_format = 33;
    if (_internal_format == GL_RGB4)	 internal_format = 34;
    if (_internal_format == GL_RGB5)	 internal_format = 35;
    if (_internal_format == GL_RGB8)	 internal_format = 36;
    if (_internal_format == GL_RGB10)	 internal_format = 37;
    if (_internal_format == GL_RGB12)	 internal_format = 38;
    if (_internal_format == GL_RGB16)	 internal_format = 39;
    if (_internal_format == GL_RGBA)	 internal_format = 40;
    if (_internal_format == GL_RGBA2)	 internal_format = 41;
    if (_internal_format == GL_RGBA4)	 internal_format = 42;
    if (_internal_format == GL_RGB5_A1)	 internal_format = 43;
    if (_internal_format == GL_RGBA8)	 internal_format = 44;
    if (_internal_format == GL_RGB10_A2)	 internal_format = 45;
    if (_internal_format == GL_RGBA12)	 internal_format = 46;
    if (_internal_format == GL_RGBA16)	 internal_format = 47;
    if (_internal_format == GL_SLUMINANCE)	 internal_format = 48;
    if (_internal_format == GL_SLUMINANCE8)	 internal_format = 49;
    if (_internal_format == GL_SLUMINANCE_ALPHA)	 internal_format = 50;
    if (_internal_format == GL_SLUMINANCE8_ALPHA8)	 internal_format = 51;
    if (_internal_format == GL_SRGB)	 internal_format = 52;
    if (_internal_format == GL_SRGB8)	 internal_format = 53;
    if (_internal_format == GL_SRGB_ALPHA)	 internal_format = 54;
    if (_internal_format == GL_SRGB8_ALPHA8)	 internal_format = 55;
  }
